import { defineStore } from 'pinia';
import { Request } from '@/app/request.js';
import type { SelectOption } from '@/common/types/app.js';
import { reactive, ref } from 'vue';

export const useFeeStore = defineStore('feeSelection' , () => {
    const protocols = ref<SelectOption[]>([]); // 协议
    const mods = ref<SelectOption[]>([]); // 费用模式
    const eles = ref<SelectOption[]>([]); // 计费元素
    async function initData() {
        const req = new Request('财务DW数据查询');
        const r = await req.post();
        protocols.value = r.obj['Protocol'];
        mods.value = r.obj['Mod'];
        eles.value = r.obj['Ele'];
    }
    return {initData, protocols, mods, eles};
});